/* entity */
import Customer from '@model/entity/Customer'
import LoginUser from '@model/entity/LoginUser/LoginUser'
import TaskConfig from '@model/config/TaskConfig'
import NewTaskConfig from '@model/config/NewTaskConfig'
import TaskAllotUserInfo from '@model/entity/TaskAllotUserInfo'
import TaskType from '@model/entity/TaskType'
import Tag from '@model/entity/Tag/Tag'
/* enum */
import TaskAllotTypeEnum from '@model/enum/TaskAllotTypeEnum'
import ComponentNameEnum from '@model/enum/ComponentNameEnum'
/* model */
import { TaskAllotTypeModeEnum, ICreateEditTask } from '@src/modules/task/components/TaskAllotModal/TaskAllotModalModel'
/* props */
import TaskAllotModalProps from '@src/modules/task/components/TaskAllotModal/TaskAllotModalProps'
/* types */
import StateColorMap from '@model/types/StateColor'
import AutoDispatchListItem from '@model/types/AutoDispatchListItem'
import { TaskPoolNotificationTypeEnum } from '@src/modules/task/components/TaskAllotModal/TaskAllotPool/TaskAllotPoolModel'
import { TaskAllotServiceProviderInfo } from '@src/modules/task/components/TaskAllotModal/TaskAllotServiceProvider/TaskAllotServiceProviderModel'
class TaskAllotModalData extends TaskAllotModalProps {
  /* 派单方式 */
  public allotType: TaskAllotTypeEnum = TaskAllotTypeEnum.Person
  /* 派单方式 模式(列表，地图) */
  public allotTypeMode: TaskAllotTypeModeEnum = TaskAllotTypeModeEnum.List
  /* 客户信息 */
  public customer: Customer = {}
  /* 客户团队信息 */
  public customerTags: Tag[] = []
  /* 负责人 */
  public executorUser: LoginUser | TaskAllotUserInfo | null = null
  /* 是否使用匹配出的预估结果 */
  public isUsedResult: boolean = false
  /* 已经加载的组件列表 TODO: 实现 keep-alive component 功能 */
  public loadedComponents: string[] = [ComponentNameEnum.TaskAllotExcutor]
  /* 匹配的规则结果 */
  public matchRule: AutoDispatchListItem | null = null
  /* 最大协同人数量 */
  public readonly maxSynergyUserCount: number = 100
  /* 等待状态 */
  public pending: boolean = false
  /* 转派说明 */
  public reason: string = ''
  /* 是否开通了日历派单 */
  public isCalendar: boolean = false
  /* 是否有工单编辑权限 */
  public allowEditTask: boolean = false
  /* 转派选择 */
  public transferList: Array<string> = ['1','2','3']
  /* 转派选择的原因 */
  public customReason: string = ''
  /* 是否显示清空派单结果 */
  public showClearTaskAllotResultButton: boolean = false
  /* 是否显示派单弹窗 */
  public showTaskAllotModal: boolean = false
  /* 协同人列表 */
  public synergyUserList: LoginUser[] = []
  /* 计划开始时间 */
  public calendarStartTime: string = ''
  /* 计划结束时间 */
  public calendarEndTime: string = ''
  // 是否展示日历派单按钮
  public isShowCalendarBtn: boolean = false
  /* 工作状态 */
  public stateColorMap: StateColorMap = {}
  /* 工单设置 */
  public taskConfig: TaskConfig = new TaskConfig()
  /* 新版工单设置 */
  public newTaskConfig: NewTaskConfig = new NewTaskConfig()
  /* 工单通知复选框 */
  public taskPoolNotificationCheckd: TaskPoolNotificationTypeEnum[] = []
  /* 工单池通知自定义人员 */
  public taskPoolNotificationUsers: LoginUser[] = []
  /* 工单类型数据 */
  public taskType: TaskType | null = null
  /* 工单类型列表 */
  public taskTypes: TaskType[] = []
  /* 工单类型列表map */
  public taskTypesMap: { [x: string]: TaskType} = {}
  /* 转派at */
  public atUsers: any[] = []
  /* 选中的服务商 */
  public serviceProvider:TaskAllotServiceProviderInfo[] = []
  /* 新建和编辑时的工单数据 */
  public createEditTask:ICreateEditTask = {}
}

export default TaskAllotModalData
